function $() {
  var elements = new Array();
  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);
    if (arguments.length == 1) 
      return element;
    elements.push(element);
  }
  return elements;
}

function Trim(s) {
	s = s.replace(/(^\s+)|(\s+$)/ig,"");
	s = s.replace(/\u3000+/g, " ");
	s = s.replace(/\s+/g," ");
	return s;
}

function htmlDecode (str){
 	var div = document.createElement("textarea");
 	div.innerHTML = str;
	return document.all?div.innerText:div.textContent;
}

function getWindowHeight() {
	if (window.self && self.innerHeight) {
		return self.innerHeight;
	}
	if (document.documentElement && document.documentElement.clientHeight) {
		return document.documentElement.clientHeight;
	}
	return 0;
}
function getWindowWidth() {
	if (window.self && self.innerWidth) {
		return self.innerWidth;
	}
	if (document.documentElement && document.documentElement.clientWidth) {
		return document.documentElement.clientWidth;
	}
	return 0;
} 
